import request from "@Utils/webServerRequest"
import moment from 'moment'
import dyrequest from "@Utils/request"
// 拆词
export const getJiebaApi = (title) => {
    return request({
        url: `api/tools/getJieba`,
        method: "get",
        paramete: {
            title
        }
    })
}

// 获取推荐搜索词
export const getSearchWordApi = (data) => {
    console.log('data', data)
    return dyrequest({
        url: `compass_api/shop/mall/search_analysis/seo/cold_start`,
        method: "get",
        paramete: {
            date_type: 23,
            end_date: data.end_date || moment().startOf('day').subtract(2, 'days').format('YYYY/MM/DD HH:mm:ss'),
            begin_date: data.begin_date ||moment().startOf('day').subtract(15, 'days').format('YYYY/MM/DD HH:mm:ss'),
            index_selected: data.index_selected || 'query_click_pay_ucnt_ratio,query_search_click_ucnt_ratio,query_hot_index',
            product_id: data.product_id || '',
            intention: data.intention || '7', // 5无品牌？  7干净
            rank_type: data.rank_type || '1',
            is_asc: data.is_asc || false,
            sort_field: data.sort_field || 'growth_rate',
            page_no: data.page || 1,
            page_size: data.pageSize || data.page_size || data.size || 100,
        //   _bid: "ffa_order"
        }
    })
}
// 获取osskey
export const getOssKeyApi = (data) => {
    return request({
        url: `api/tools/ossSts`,
        method: "get",
        paramete: {}
    })
}
// 保存cookie 
export const savePageCookie = (data) => {
    return request({
        url: `api/tools/savePageCI`,
        method: "post",
        paramete: {},
        data
    })
}

export const statisticsJupAotoTkNum = () => {
    return request({
        url: `api/tools/statisticsJupAotoTkNum`,
        method: "get",
        paramete: {}
    })
}